package com.liang.mall.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.liang.mall.group.Insert;
import com.liang.mall.group.Update;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
//import org.springframework.security.core.GrantedAuthority;
//import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Collection;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author lin
 * @since 2021-05-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("bz_admin")
@Validated
public class Admin {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    @NotNull(groups = {Update.class},message = "id不能为空")
    private Integer id;

    @NotEmpty(groups = {Insert.class},message = "用户名不能为空")
    private String username;

    @NotEmpty(groups = {Insert.class},message = "密码不能为空")
    private String password;

    @NotEmpty(groups = {Insert.class},message = "邮箱不能为空")
    private String email;

    private String telphone;

    @TableField(fill = FieldFill.INSERT)
    private Date createTime;


    private Integer status;

//    @TableLogic
@TableField(fill = FieldFill.INSERT)
@TableLogic //逻辑删除
    private Integer deleted;


}
